import React from "react";
import { observer } from "mobx-react";
import Workspace from "./Workspace";
import { WeaInput, WeaError, WeaLocaleProvider } from 'ecCom';
import { Popover } from 'antd';

import Condition from "./Condition";
import "./index.less";
const getLabel = WeaLocaleProvider.getLabel;

@observer
export default class EditorContent extends React.Component {
    render() {
        const { store } = this.props;
        const { name, onTableAdd } = store;
        return (
            <div className='edc-ds-content'>
                <header className='edc-ds-content-title'>
                    <div>
                        <label>{getLabel('506105','名称')}</label>
                        <WeaError
                            tipPosition='bottom'
                            ref={ref => store.nameError = ref}
                            error={getLabel('507218','名称为空')}>
                            <WeaInput style={{ width: 300, marginLeft: 10 }} value={name} viewAttr={3} onChange={store.changeName}></WeaInput>
                        </WeaError>
                    </div>
                </header>
                <Workspace onDrop={onTableAdd} store={store} />
            </div>
        );
    }
}